home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 October / MACPOWER-1997-10.ISO.7z / MACPOWER-1997-10.ISO / AMUG / PROGRAMMING / Mac F2C 1.3.5.sit / Mac F2C 1.3.5 / Mac F2C Libraries / libF77 Sources / getarg_.c < prev    next >
C/C++ Source or Header  |  1995-01-28  |  495b  |  29 lines

  1. #include "f2c.h"
  2.  
  3. /*
  4.  * subroutine getarg(k, c)
  5.  * returns the kth unix command argument in fortran character
  6.  * variable argument c
  7. */
  8.  
  9. #ifdef KR_headers
  10. VOID getarg_(n, s, ls) ftnint *n; register char *s; ftnlen ls;
  11. #else
  12. void getarg_(ftnint *n, register char *s, ftnlen ls)
  13. #endif
  14. {
  15. extern int xargc;
  16. extern char **xargv;
  17. register char *t;
  18. register int i;
  19.  
  20. if(*n>=0 && *n<xargc)
  21.     t = xargv[*n];
  22. else
  23.     t = "";
  24. for(i = 0; i<ls && *t!='¥0' ; ++i)
  25.     *s++ = *t++;
  26. for( ; i<ls ; ++i)
  27.     *s++ = ' ';
  28. }
  29.